3.54 \(\int \frac {(c+d \tan (e+f x)) (A+B \tan (e+f x)+C \tan ^2(e+f x))}{a+b \tan (e+f x)} \, dx\)

Optimal. Leaf size=156 \[ \frac {(b c-a d) \left (A b^2-a (b B-a C)\right ) \log (a+b \tan (e+f x))}{b^2 f \left (a^2+b^2\right )}+\frac {\log (\cos (e+f x)) (-a A d-a B c+a C d+A b c-b B d-b c C)}{f \left (a^2+b^2\right )}+\frac {x (a (A c-B d-c C)+b (d (A-C)+B c))}{a^2+b^2}+\frac {C d \tan (e+f x)}{b f} \]

[Out]

(a*(A*c-B*d-C*c)+b*(B*c+(A-C)*d))*x/(a^2+b^2)+(-A*a*d+A*b*c-B*a*c-B*b*d+C*a*d-C*b*c)*ln(cos(f*x+e))/(a^2+b^2)/
f+(A*b^2-a*(B*b-C*a))*(-a*d+b*c)*ln(a+b*tan(f*x+e))/b^2/(a^2+b^2)/f+C*d*tan(f*x+e)/b/f

________________________________________________________________________________________

Rubi [A]  time = 0.35, antiderivative size = 155, normalized size of antiderivative = 0.99, number of steps used = 5, number of rules used = 5, integrand size = 43, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.116, Rules used = {3637, 3626, 3617, 31, 3475} \[ \frac {(b c-a d) \left (A b^2-a (b B-a C)\right ) \log (a+b \tan (e+f x))}{b^2 f \left (a^2+b^2\right )}+\frac {\log (\cos (e+f x)) (-a A d-a B c+a C d+A b c-b B d-b c C)}{f \left (a^2+b^2\right )}+\frac {x (a (A c-B d-c C)+b d (A-C)+b B c)}{a^2+b^2}+\frac {C d \tan (e+f x)}{b f} \]

Antiderivative was successfully verified.

[In]

Int[((c + d*Tan[e + f*x])*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2))/(a + b*Tan[e + f*x]),x]

[Out]

((b*B*c + b*(A - C)*d + a*(A*c - c*C - B*d))*x)/(a^2 + b^2) + ((A*b*c - a*B*c - b*c*C - a*A*d - b*B*d + a*C*d)
*Log[Cos[e + f*x]])/((a^2 + b^2)*f) + ((A*b^2 - a*(b*B - a*C))*(b*c - a*d)*Log[a + b*Tan[e + f*x]])/(b^2*(a^2
+ b^2)*f) + (C*d*Tan[e + f*x])/(b*f)

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3617

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Dist[
A/(b*f), Subst[Int[(a + x)^m, x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, A, C, m}, x] && EqQ[A, C]

Rule 3626

Int[((A_) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2)/((a_.) + (b_.)*tan[(e_.) + (f_.)*
(x_)]), x_Symbol] :> Simp[((a*A + b*B - a*C)*x)/(a^2 + b^2), x] + (Dist[(A*b^2 - a*b*B + a^2*C)/(a^2 + b^2), I
nt[(1 + Tan[e + f*x]^2)/(a + b*Tan[e + f*x]), x], x] - Dist[(A*b - a*B - b*C)/(a^2 + b^2), Int[Tan[e + f*x], x
], x]) /; FreeQ[{a, b, e, f, A, B, C}, x] && NeQ[A*b^2 - a*b*B + a^2*C, 0] && NeQ[a^2 + b^2, 0] && NeQ[A*b - a
*B - b*C, 0]

Rule 3637

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (B_.)*tan[(e
_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(b*C*Tan[e + f*x]*(c + d*Tan[e + f*x])
^(n + 1))/(d*f*(n + 2)), x] - Dist[1/(d*(n + 2)), Int[(c + d*Tan[e + f*x])^n*Simp[b*c*C - a*A*d*(n + 2) - (A*b
 + a*B - b*C)*d*(n + 2)*Tan[e + f*x] - (a*C*d*(n + 2) - b*(c*C - B*d*(n + 2)))*Tan[e + f*x]^2, x], x], x] /; F
reeQ[{a, b, c, d, e, f, A, B, C, n}, x] && NeQ[b*c - a*d, 0] && NeQ[c^2 + d^2, 0] &&  !LtQ[n, -1]

Rubi steps

\begin {align*} \int \frac {(c+d \tan (e+f x)) \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{a+b \tan (e+f x)} \, dx &=\frac {C d \tan (e+f x)}{b f}-\frac {\int \frac {-A b c+a C d-b (B c+(A-C) d) \tan (e+f x)-(b c C+b B d-a C d) \tan ^2(e+f x)}{a+b \tan (e+f x)} \, dx}{b}\\ &=\frac {(b B c+b (A-C) d+a (A c-c C-B d)) x}{a^2+b^2}+\frac {C d \tan (e+f x)}{b f}+\frac {\left (\left (A b^2-a (b B-a C)\right ) (b c-a d)\right ) \int \frac {1+\tan ^2(e+f x)}{a+b \tan (e+f x)} \, dx}{b \left (a^2+b^2\right )}-\frac {(A b c-a B c-b c C-a A d-b B d+a C d) \int \tan (e+f x) \, dx}{a^2+b^2}\\ &=\frac {(b B c+b (A-C) d+a (A c-c C-B d)) x}{a^2+b^2}+\frac {(A b c-a B c-b c C-a A d-b B d+a C d) \log (\cos (e+f x))}{\left (a^2+b^2\right ) f}+\frac {C d \tan (e+f x)}{b f}+\frac {\left (\left (A b^2-a (b B-a C)\right ) (b c-a d)\right ) \operatorname {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \tan (e+f x)\right )}{b^2 \left (a^2+b^2\right ) f}\\ &=\frac {(b B c+b (A-C) d+a (A c-c C-B d)) x}{a^2+b^2}+\frac {(A b c-a B c-b c C-a A d-b B d+a C d) \log (\cos (e+f x))}{\left (a^2+b^2\right ) f}+\frac {\left (A b^2-a (b B-a C)\right ) (b c-a d) \log (a+b \tan (e+f x))}{b^2 \left (a^2+b^2\right ) f}+\frac {C d \tan (e+f x)}{b f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C]  time = 1.19, size = 148, normalized size = 0.95 \[ \frac {\frac {2 (b c-a d) \left (a (a C-b B)+A b^2\right ) \log (a+b \tan (e+f x))}{b^2 \left (a^2+b^2\right )}+\frac {(d-i c) (A+i B-C) \log (-\tan (e+f x)+i)}{a+i b}+\frac {(d+i c) (A-i B-C) \log (\tan (e+f x)+i)}{a-i b}+\frac {2 C d \tan (e+f x)}{b}}{2 f} \]

Antiderivative was successfully verified.

[In]

Integrate[((c + d*Tan[e + f*x])*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2))/(a + b*Tan[e + f*x]),x]

[Out]

(((A + I*B - C)*((-I)*c + d)*Log[I - Tan[e + f*x]])/(a + I*b) + ((A - I*B - C)*(I*c + d)*Log[I + Tan[e + f*x]]
)/(a - I*b) + (2*(A*b^2 + a*(-(b*B) + a*C))*(b*c - a*d)*Log[a + b*Tan[e + f*x]])/(b^2*(a^2 + b^2)) + (2*C*d*Ta
n[e + f*x])/b)/(2*f)

________________________________________________________________________________________

fricas [A]  time = 1.44, size = 226, normalized size = 1.45 \[ \frac {2 \, {\left ({\left ({\left (A - C\right )} a b^{2} + B b^{3}\right )} c - {\left (B a b^{2} - {\left (A - C\right )} b^{3}\right )} d\right )} f x + 2 \, {\left (C a^{2} b + C b^{3}\right )} d \tan \left (f x + e\right ) + {\left ({\left (C a^{2} b - B a b^{2} + A b^{3}\right )} c - {\left (C a^{3} - B a^{2} b + A a b^{2}\right )} d\right )} \log \left (\frac {b^{2} \tan \left (f x + e\right )^{2} + 2 \, a b \tan \left (f x + e\right ) + a^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) - {\left ({\left (C a^{2} b + C b^{3}\right )} c - {\left (C a^{3} - B a^{2} b + C a b^{2} - B b^{3}\right )} d\right )} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right )}{2 \, {\left (a^{2} b^{2} + b^{4}\right )} f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))*(A+B*tan(f*x+e)+C*tan(f*x+e)^2)/(a+b*tan(f*x+e)),x, algorithm="fricas")

[Out]

1/2*(2*(((A - C)*a*b^2 + B*b^3)*c - (B*a*b^2 - (A - C)*b^3)*d)*f*x + 2*(C*a^2*b + C*b^3)*d*tan(f*x + e) + ((C*
a^2*b - B*a*b^2 + A*b^3)*c - (C*a^3 - B*a^2*b + A*a*b^2)*d)*log((b^2*tan(f*x + e)^2 + 2*a*b*tan(f*x + e) + a^2
)/(tan(f*x + e)^2 + 1)) - ((C*a^2*b + C*b^3)*c - (C*a^3 - B*a^2*b + C*a*b^2 - B*b^3)*d)*log(1/(tan(f*x + e)^2
+ 1)))/((a^2*b^2 + b^4)*f)

________________________________________________________________________________________

giac [A]  time = 1.79, size = 186, normalized size = 1.19 \[ \frac {\frac {2 \, C d \tan \left (f x + e\right )}{b} + \frac {2 \, {\left (A a c - C a c + B b c - B a d + A b d - C b d\right )} {\left (f x + e\right )}}{a^{2} + b^{2}} + \frac {{\left (B a c - A b c + C b c + A a d - C a d + B b d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{a^{2} + b^{2}} + \frac {2 \, {\left (C a^{2} b c - B a b^{2} c + A b^{3} c - C a^{3} d + B a^{2} b d - A a b^{2} d\right )} \log \left ({\left | b \tan \left (f x + e\right ) + a \right |}\right )}{a^{2} b^{2} + b^{4}}}{2 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))*(A+B*tan(f*x+e)+C*tan(f*x+e)^2)/(a+b*tan(f*x+e)),x, algorithm="giac")

[Out]

1/2*(2*C*d*tan(f*x + e)/b + 2*(A*a*c - C*a*c + B*b*c - B*a*d + A*b*d - C*b*d)*(f*x + e)/(a^2 + b^2) + (B*a*c -
 A*b*c + C*b*c + A*a*d - C*a*d + B*b*d)*log(tan(f*x + e)^2 + 1)/(a^2 + b^2) + 2*(C*a^2*b*c - B*a*b^2*c + A*b^3
*c - C*a^3*d + B*a^2*b*d - A*a*b^2*d)*log(abs(b*tan(f*x + e) + a))/(a^2*b^2 + b^4))/f

________________________________________________________________________________________

maple [B]  time = 0.24, size = 506, normalized size = 3.24 \[ \frac {C d \tan \left (f x +e \right )}{b f}-\frac {\ln \left (a +b \tan \left (f x +e \right )\right ) A a d}{f \left (a^{2}+b^{2}\right )}+\frac {b \ln \left (a +b \tan \left (f x +e \right )\right ) A c}{f \left (a^{2}+b^{2}\right )}+\frac {\ln \left (a +b \tan \left (f x +e \right )\right ) B \,a^{2} d}{f b \left (a^{2}+b^{2}\right )}-\frac {\ln \left (a +b \tan \left (f x +e \right )\right ) B a c}{f \left (a^{2}+b^{2}\right )}-\frac {\ln \left (a +b \tan \left (f x +e \right )\right ) a^{3} C d}{f \,b^{2} \left (a^{2}+b^{2}\right )}+\frac {\ln \left (a +b \tan \left (f x +e \right )\right ) C \,a^{2} c}{f b \left (a^{2}+b^{2}\right )}+\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) A a d}{2 f \left (a^{2}+b^{2}\right )}-\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) A b c}{2 f \left (a^{2}+b^{2}\right )}+\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) B a c}{2 f \left (a^{2}+b^{2}\right )}+\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) B b d}{2 f \left (a^{2}+b^{2}\right )}-\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) a C d}{2 f \left (a^{2}+b^{2}\right )}+\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) C b c}{2 f \left (a^{2}+b^{2}\right )}+\frac {A \arctan \left (\tan \left (f x +e \right )\right ) a c}{f \left (a^{2}+b^{2}\right )}+\frac {A \arctan \left (\tan \left (f x +e \right )\right ) b d}{f \left (a^{2}+b^{2}\right )}-\frac {B \arctan \left (\tan \left (f x +e \right )\right ) a d}{f \left (a^{2}+b^{2}\right )}+\frac {B \arctan \left (\tan \left (f x +e \right )\right ) b c}{f \left (a^{2}+b^{2}\right )}-\frac {C \arctan \left (\tan \left (f x +e \right )\right ) a c}{f \left (a^{2}+b^{2}\right )}-\frac {C \arctan \left (\tan \left (f x +e \right )\right ) b d}{f \left (a^{2}+b^{2}\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c+d*tan(f*x+e))*(A+B*tan(f*x+e)+C*tan(f*x+e)^2)/(a+b*tan(f*x+e)),x)

[Out]

C*d*tan(f*x+e)/b/f-1/f/(a^2+b^2)*ln(a+b*tan(f*x+e))*A*a*d+1/f*b/(a^2+b^2)*ln(a+b*tan(f*x+e))*A*c+1/f/b/(a^2+b^
2)*ln(a+b*tan(f*x+e))*B*a^2*d-1/f/(a^2+b^2)*ln(a+b*tan(f*x+e))*B*a*c-1/f/b^2/(a^2+b^2)*ln(a+b*tan(f*x+e))*a^3*
C*d+1/f/b/(a^2+b^2)*ln(a+b*tan(f*x+e))*C*a^2*c+1/2/f/(a^2+b^2)*ln(1+tan(f*x+e)^2)*A*a*d-1/2/f/(a^2+b^2)*ln(1+t
an(f*x+e)^2)*A*b*c+1/2/f/(a^2+b^2)*ln(1+tan(f*x+e)^2)*B*a*c+1/2/f/(a^2+b^2)*ln(1+tan(f*x+e)^2)*B*b*d-1/2/f/(a^
2+b^2)*ln(1+tan(f*x+e)^2)*a*C*d+1/2/f/(a^2+b^2)*ln(1+tan(f*x+e)^2)*C*b*c+1/f/(a^2+b^2)*A*arctan(tan(f*x+e))*a*
c+1/f/(a^2+b^2)*A*arctan(tan(f*x+e))*b*d-1/f/(a^2+b^2)*B*arctan(tan(f*x+e))*a*d+1/f/(a^2+b^2)*B*arctan(tan(f*x
+e))*b*c-1/f/(a^2+b^2)*C*arctan(tan(f*x+e))*a*c-1/f/(a^2+b^2)*C*arctan(tan(f*x+e))*b*d

________________________________________________________________________________________

maxima [A]  time = 0.44, size = 183, normalized size = 1.17 \[ \frac {\frac {2 \, C d \tan \left (f x + e\right )}{b} + \frac {2 \, {\left ({\left ({\left (A - C\right )} a + B b\right )} c - {\left (B a - {\left (A - C\right )} b\right )} d\right )} {\left (f x + e\right )}}{a^{2} + b^{2}} + \frac {2 \, {\left ({\left (C a^{2} b - B a b^{2} + A b^{3}\right )} c - {\left (C a^{3} - B a^{2} b + A a b^{2}\right )} d\right )} \log \left (b \tan \left (f x + e\right ) + a\right )}{a^{2} b^{2} + b^{4}} + \frac {{\left ({\left (B a - {\left (A - C\right )} b\right )} c + {\left ({\left (A - C\right )} a + B b\right )} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{a^{2} + b^{2}}}{2 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))*(A+B*tan(f*x+e)+C*tan(f*x+e)^2)/(a+b*tan(f*x+e)),x, algorithm="maxima")

[Out]

1/2*(2*C*d*tan(f*x + e)/b + 2*(((A - C)*a + B*b)*c - (B*a - (A - C)*b)*d)*(f*x + e)/(a^2 + b^2) + 2*((C*a^2*b
- B*a*b^2 + A*b^3)*c - (C*a^3 - B*a^2*b + A*a*b^2)*d)*log(b*tan(f*x + e) + a)/(a^2*b^2 + b^4) + ((B*a - (A - C
)*b)*c + ((A - C)*a + B*b)*d)*log(tan(f*x + e)^2 + 1)/(a^2 + b^2))/f

________________________________________________________________________________________

mupad [B]  time = 10.13, size = 186, normalized size = 1.19 \[ \frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (A\,d+B\,c-C\,d-A\,c\,1{}\mathrm {i}+B\,d\,1{}\mathrm {i}+C\,c\,1{}\mathrm {i}\right )}{2\,f\,\left (a+b\,1{}\mathrm {i}\right )}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (B\,d+A\,d\,1{}\mathrm {i}+B\,c\,1{}\mathrm {i}-A\,c+C\,c-C\,d\,1{}\mathrm {i}\right )}{2\,f\,\left (b+a\,1{}\mathrm {i}\right )}-\frac {\ln \left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right )\,\left (b^2\,\left (A\,a\,d+B\,a\,c\right )-b\,\left (B\,a^2\,d+C\,a^2\,c\right )-A\,b^3\,c+C\,a^3\,d\right )}{f\,\left (a^2\,b^2+b^4\right )}+\frac {C\,d\,\mathrm {tan}\left (e+f\,x\right )}{b\,f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((c + d*tan(e + f*x))*(A + B*tan(e + f*x) + C*tan(e + f*x)^2))/(a + b*tan(e + f*x)),x)

[Out]

(log(tan(e + f*x) - 1i)*(A*d - A*c*1i + B*c + B*d*1i + C*c*1i - C*d))/(2*f*(a + b*1i)) + (log(tan(e + f*x) + 1
i)*(A*d*1i - A*c + B*c*1i + B*d + C*c - C*d*1i))/(2*f*(a*1i + b)) - (log(a + b*tan(e + f*x))*(b^2*(A*a*d + B*a
*c) - b*(B*a^2*d + C*a^2*c) - A*b^3*c + C*a^3*d))/(f*(b^4 + a^2*b^2)) + (C*d*tan(e + f*x))/(b*f)

________________________________________________________________________________________

sympy [A]  time = 2.37, size = 2429, normalized size = 15.57 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))*(A+B*tan(f*x+e)+C*tan(f*x+e)**2)/(a+b*tan(f*x+e)),x)

[Out]

Piecewise((zoo*x*(c + d*tan(e))*(A + B*tan(e) + C*tan(e)**2)/tan(e), Eq(a, 0) & Eq(b, 0) & Eq(f, 0)), (-I*A*c*
f*x*tan(e + f*x)/(-2*b*f*tan(e + f*x) + 2*I*b*f) - A*c*f*x/(-2*b*f*tan(e + f*x) + 2*I*b*f) - I*A*c/(-2*b*f*tan
(e + f*x) + 2*I*b*f) - A*d*f*x*tan(e + f*x)/(-2*b*f*tan(e + f*x) + 2*I*b*f) + I*A*d*f*x/(-2*b*f*tan(e + f*x) +
 2*I*b*f) + A*d/(-2*b*f*tan(e + f*x) + 2*I*b*f) - B*c*f*x*tan(e + f*x)/(-2*b*f*tan(e + f*x) + 2*I*b*f) + I*B*c
*f*x/(-2*b*f*tan(e + f*x) + 2*I*b*f) + B*c/(-2*b*f*tan(e + f*x) + 2*I*b*f) - I*B*d*f*x*tan(e + f*x)/(-2*b*f*ta
n(e + f*x) + 2*I*b*f) - B*d*f*x/(-2*b*f*tan(e + f*x) + 2*I*b*f) - B*d*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(-
2*b*f*tan(e + f*x) + 2*I*b*f) + I*B*d*log(tan(e + f*x)**2 + 1)/(-2*b*f*tan(e + f*x) + 2*I*b*f) + I*B*d/(-2*b*f
*tan(e + f*x) + 2*I*b*f) - I*C*c*f*x*tan(e + f*x)/(-2*b*f*tan(e + f*x) + 2*I*b*f) - C*c*f*x/(-2*b*f*tan(e + f*
x) + 2*I*b*f) - C*c*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(-2*b*f*tan(e + f*x) + 2*I*b*f) + I*C*c*log(tan(e +
f*x)**2 + 1)/(-2*b*f*tan(e + f*x) + 2*I*b*f) + I*C*c/(-2*b*f*tan(e + f*x) + 2*I*b*f) + 3*C*d*f*x*tan(e + f*x)/
(-2*b*f*tan(e + f*x) + 2*I*b*f) - 3*I*C*d*f*x/(-2*b*f*tan(e + f*x) + 2*I*b*f) - I*C*d*log(tan(e + f*x)**2 + 1)
*tan(e + f*x)/(-2*b*f*tan(e + f*x) + 2*I*b*f) - C*d*log(tan(e + f*x)**2 + 1)/(-2*b*f*tan(e + f*x) + 2*I*b*f) -
 2*C*d*tan(e + f*x)**2/(-2*b*f*tan(e + f*x) + 2*I*b*f) - 3*C*d/(-2*b*f*tan(e + f*x) + 2*I*b*f), Eq(a, -I*b)),
(I*A*c*f*x*tan(e + f*x)/(-2*b*f*tan(e + f*x) - 2*I*b*f) - A*c*f*x/(-2*b*f*tan(e + f*x) - 2*I*b*f) + I*A*c/(-2*
b*f*tan(e + f*x) - 2*I*b*f) - A*d*f*x*tan(e + f*x)/(-2*b*f*tan(e + f*x) - 2*I*b*f) - I*A*d*f*x/(-2*b*f*tan(e +
 f*x) - 2*I*b*f) + A*d/(-2*b*f*tan(e + f*x) - 2*I*b*f) - B*c*f*x*tan(e + f*x)/(-2*b*f*tan(e + f*x) - 2*I*b*f)
- I*B*c*f*x/(-2*b*f*tan(e + f*x) - 2*I*b*f) + B*c/(-2*b*f*tan(e + f*x) - 2*I*b*f) + I*B*d*f*x*tan(e + f*x)/(-2
*b*f*tan(e + f*x) - 2*I*b*f) - B*d*f*x/(-2*b*f*tan(e + f*x) - 2*I*b*f) - B*d*log(tan(e + f*x)**2 + 1)*tan(e +
f*x)/(-2*b*f*tan(e + f*x) - 2*I*b*f) - I*B*d*log(tan(e + f*x)**2 + 1)/(-2*b*f*tan(e + f*x) - 2*I*b*f) - I*B*d/
(-2*b*f*tan(e + f*x) - 2*I*b*f) + I*C*c*f*x*tan(e + f*x)/(-2*b*f*tan(e + f*x) - 2*I*b*f) - C*c*f*x/(-2*b*f*tan
(e + f*x) - 2*I*b*f) - C*c*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(-2*b*f*tan(e + f*x) - 2*I*b*f) - I*C*c*log(t
an(e + f*x)**2 + 1)/(-2*b*f*tan(e + f*x) - 2*I*b*f) - I*C*c/(-2*b*f*tan(e + f*x) - 2*I*b*f) + 3*C*d*f*x*tan(e
+ f*x)/(-2*b*f*tan(e + f*x) - 2*I*b*f) + 3*I*C*d*f*x/(-2*b*f*tan(e + f*x) - 2*I*b*f) + I*C*d*log(tan(e + f*x)*
*2 + 1)*tan(e + f*x)/(-2*b*f*tan(e + f*x) - 2*I*b*f) - C*d*log(tan(e + f*x)**2 + 1)/(-2*b*f*tan(e + f*x) - 2*I
*b*f) - 2*C*d*tan(e + f*x)**2/(-2*b*f*tan(e + f*x) - 2*I*b*f) - 3*C*d/(-2*b*f*tan(e + f*x) - 2*I*b*f), Eq(a, I
*b)), ((A*c*x + A*d*log(tan(e + f*x)**2 + 1)/(2*f) + B*c*log(tan(e + f*x)**2 + 1)/(2*f) - B*d*x + B*d*tan(e +
f*x)/f - C*c*x + C*c*tan(e + f*x)/f - C*d*log(tan(e + f*x)**2 + 1)/(2*f) + C*d*tan(e + f*x)**2/(2*f))/a, Eq(b,
 0)), (x*(c + d*tan(e))*(A + B*tan(e) + C*tan(e)**2)/(a + b*tan(e)), Eq(f, 0)), (2*A*a*b**2*c*f*x/(2*a**2*b**2
*f + 2*b**4*f) - 2*A*a*b**2*d*log(a/b + tan(e + f*x))/(2*a**2*b**2*f + 2*b**4*f) + A*a*b**2*d*log(tan(e + f*x)
**2 + 1)/(2*a**2*b**2*f + 2*b**4*f) + 2*A*b**3*c*log(a/b + tan(e + f*x))/(2*a**2*b**2*f + 2*b**4*f) - A*b**3*c
*log(tan(e + f*x)**2 + 1)/(2*a**2*b**2*f + 2*b**4*f) + 2*A*b**3*d*f*x/(2*a**2*b**2*f + 2*b**4*f) + 2*B*a**2*b*
d*log(a/b + tan(e + f*x))/(2*a**2*b**2*f + 2*b**4*f) - 2*B*a*b**2*c*log(a/b + tan(e + f*x))/(2*a**2*b**2*f + 2
*b**4*f) + B*a*b**2*c*log(tan(e + f*x)**2 + 1)/(2*a**2*b**2*f + 2*b**4*f) - 2*B*a*b**2*d*f*x/(2*a**2*b**2*f +
2*b**4*f) + 2*B*b**3*c*f*x/(2*a**2*b**2*f + 2*b**4*f) + B*b**3*d*log(tan(e + f*x)**2 + 1)/(2*a**2*b**2*f + 2*b
**4*f) - 2*C*a**3*d*log(a/b + tan(e + f*x))/(2*a**2*b**2*f + 2*b**4*f) + 2*C*a**2*b*c*log(a/b + tan(e + f*x))/
(2*a**2*b**2*f + 2*b**4*f) + 2*C*a**2*b*d*tan(e + f*x)/(2*a**2*b**2*f + 2*b**4*f) - 2*C*a*b**2*c*f*x/(2*a**2*b
**2*f + 2*b**4*f) - C*a*b**2*d*log(tan(e + f*x)**2 + 1)/(2*a**2*b**2*f + 2*b**4*f) + C*b**3*c*log(tan(e + f*x)
**2 + 1)/(2*a**2*b**2*f + 2*b**4*f) - 2*C*b**3*d*f*x/(2*a**2*b**2*f + 2*b**4*f) + 2*C*b**3*d*tan(e + f*x)/(2*a
**2*b**2*f + 2*b**4*f), True))

________________________________________________________________________________________